package com.mall.business.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mall.business.domain.TCouponUser;
import com.mall.business.mapper.TCouponUserMapper;
import com.mall.business.service.ITCouponUserService;
import com.mall.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 用户优惠券Service业务层处理
 *
 * @author ruoyi
 * @date 2025-03-30
 */
@Service
public class TCouponUserServiceImpl extends ServiceImpl<TCouponUserMapper, TCouponUser>  implements ITCouponUserService
{
    @Autowired
    private TCouponUserMapper tCouponUserMapper;

    /**
     * 查询用户优惠券
     *
     * @param id 用户优惠券主键
     * @return 用户优惠券
     */
    @Override
    public TCouponUser selectTCouponUserById(String id)
    {
        return tCouponUserMapper.selectTCouponUserById(id);
    }

    /**
     * 查询用户优惠券列表
     *
     * @param tCouponUser 用户优惠券
     * @return 用户优惠券
     */
    @Override
    public List<TCouponUser> selectTCouponUserList(TCouponUser tCouponUser)
    {
        return tCouponUserMapper.selectTCouponUserList(tCouponUser);
    }

    /**
     * 新增用户优惠券
     *
     * @param tCouponUser 用户优惠券
     * @return 结果
     */
    @Override
    public int insertTCouponUser(TCouponUser tCouponUser)
    {
                tCouponUser.setCreateTime(DateUtils.getNowDate());
            return tCouponUserMapper.insertTCouponUser(tCouponUser);
    }

    /**
     * 修改用户优惠券
     *
     * @param tCouponUser 用户优惠券
     * @return 结果
     */
    @Override
    public int updateTCouponUser(TCouponUser tCouponUser)
    {
                tCouponUser.setUpdateTime(DateUtils.getNowDate());
        return tCouponUserMapper.updateTCouponUser(tCouponUser);
    }

    /**
     * 批量删除用户优惠券
     *
     * @param ids 需要删除的用户优惠券主键
     * @return 结果
     */
    @Override
    public int deleteTCouponUserByIds(String[] ids)
    {
        return tCouponUserMapper.deleteTCouponUserByIds(ids);
    }

    /**
     * 删除用户优惠券信息
     *
     * @param id 用户优惠券主键
     * @return 结果
     */
    @Override
    public int deleteTCouponUserById(String id)
    {
        return tCouponUserMapper.deleteTCouponUserById(id);
    }
}
